<?php 
$db = new DBManager ( 'localhost', 'root', '', 'iumus' );
$query="SELECT idFilm, title ,COUNT(*) as num_noleggi FROM filmnoleggio,movie WHERE idFilm=id GROUP BY idFilm ORDER BY num_noleggi DESC limit 0,7";
$result=$db->executeQuery ($query);
$string='';
while($row=mysql_fetch_array($result)){
	$string.='<li><a href="'.'../infoFilm.php?id='.$row['idFilm'].'">'.$row['title'].'</a></li>';
}
echo $string;
/*SELECT teaching_id, name, COUNT( * ) AS num_commenti
FROM teaching_properties,course_teachings 
where teaching_properties.id_teaching=course_teachings.teaching_id
GROUP BY teaching_id
LIMIT 0 , 30
*/
?>

